import { createRouter, createWebHashHistory } from 'vue-router';
import Situation from '../views/situation/index.vue';
import Crossing from '../views/situation/Crossing.vue'; //路口态势
import Trunk from '../views/situation/Trunk.vue'; //干线态势
import Traffic from '../views/situation/Traffic.vue'; //交通事件
import Car from '../views/situation/Car.vue'; //车路行为
import Synergy from '../views/synergy/index.vue';
import Decision from '../views/synergy/Decision.vue'; //协同控制决策
import Warning from '../views/synergy/Warning.vue'; //协同规划预警
import Delay from '../views/synergy/Delay.vue'; //协同感知时延

const routes = [
  {
    path: '/',
    redirect: '/Situation'
  },
  {
    path: '/Situation',
    name: 'Situation',
    redirect: '/Situation/Crossing',
    component: Situation,
    children: [
      {
        path: '/Situation/Crossing',
        name: 'Crossing',
        component: Crossing
      },
      {
        path: '/Situation/Trunk',
        name: 'Trunk',
        component: Trunk
      },
      {
        path: '/Situation/Traffic',
        name: 'Traffic',
        component: Traffic
      },
      {
        path: '/Situation/Car',
        name: 'Car',
        component: Car
      }
    ]
  },
  {
    path: '/Synergy',
    name: 'Synergy',
    redirect: '/Synergy/Delay',
    component: Synergy,
    children: [
      {
        path: '/Synergy/Decision',
        name: 'Decision',
        component: Decision
      },
      {
        path: '/Synergy/Warning',
        name: 'Warning',
        component: Warning
      },
      {
        path: '/Synergy/Delay',
        name: 'Delay',
        component: Delay
      }
    ]
  }
];

const router = createRouter({
  history: createWebHashHistory(),
  routes
});

export default router;
